import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import('@/views/home/index.vue')
const Question = () => import('@/views/question/index.vue')
const Video = () => import('@/views/video/index.vue')
const User = () => import('@/views/user/index.vue')
const Profile = () => import('@/views/user/profile/index.vue')
const Chat = () => import('@/views/user/chat/index.vue')
const Article = () => import('@/views/article/index.vue')
const Tabbar = () => import('@/components/app-tabbar.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    alias: '/home',
    components: {
      default: Home,
      bottom: Tabbar
    }
  },
  {
    path: '/question',
    components: {
      default: Question,
      bottom: Tabbar
    }
  },
  {
    path: '/video',
    components: {
      default: Video,
      bottom: Tabbar
    }
  },
  {
    path: '/user',
    components: {
      default: User,
      bottom: Tabbar
    }
  },
  {
    path: '/user/profile',
    component: Profile
  },
  {
    path: '/user/chat',
    component: Chat
  },
  {
    path: '/article',
    component: Article
  }
]

const router = new VueRouter({
  routes
})

export default router
